package com.vesystem.vegua.modules.common.controller;


import cn.hutool.json.JSONObject;
import com.vesystem.vegua.modules.common.dto.SysConfigDto;
import com.vesystem.vegua.modules.common.service.impl.SysAuthorizationServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hcy
 * @since 2020-12-11
 */
@RestController
@RequestMapping("sys")
public class SysAuthorizationController {

    @Autowired
    private SysAuthorizationServiceImpl sysAuthorizationService;

    @GetMapping("getSysAuthorizationInfo")
    public JSONObject getSysAuthorizationInfo(){
        return sysAuthorizationService.getSysAuthorizationInfo();
    }

    @PostMapping("updateSysAuthorizationInfo")
    public void updateSysAuthorizationInfo(MultipartFile file){
        sysAuthorizationService.updateSysAuthorizationInfo(file);
    }

    @GetMapping("getSysConfigDtoList")
    @Deprecated // 系统配置请使用 nacos 统一管理
    public List<SysConfigDto> getSysConfigDtoList(){
        return sysAuthorizationService.getSysConfigDtoList();
    }

}

